from matplotlib import pyplot as plt
# matplotlib 官网 https://pypi.org/project/matplotlib/
# 本例来自于《数据科学入门 第2版》
# 2021-06-23 13:39 by 炸天帮成员

years = [1950,1960,1970,1980,1990,2000,2010]
gdp = [300.2,543.3,1075.9,2862.5,5979.6,10289.7,14958.3]

# 创建一个以years为X轴,gdp为y轴的线图
plt.plot(years,gdp,color='green',marker='o',linestyle= 'solid')
# 添加标题
plt.title("Nominal GDP")
# 为y轴添加标签
plt.ylabel("Billions of $")
plt.show()
